﻿using System;
using System.Collections.Generic;

namespace NewsSystem.Models
{
    public class User
    {
        private ICollection<Article> articles;
        private ICollection<Comment> comments;
        private ICollection<Vote> votes;

        public User()
        {
            this.articles = new HashSet<Article>();
            this.comments = new HashSet<Comment>();
            this.votes = new HashSet<Vote>();
        }

        public int Id { get; set; }

        public string Email { get; set; }

        public string NickName { get; set; }

        public string PasswordHashed { get; set; }

        public string SessionId { get; set; }

        public DateTime ExpireDate { get; set; }

        public virtual ICollection<Article> Articles
        {
            get
            {
                return this.articles;
            }

            set
            {
                this.articles = value;
            }
        }

        public virtual ICollection<Comment> Comments
        {
            get
            {
                return this.comments;
            }

            set
            {
                this.comments = value;
            }
        }

        public virtual ICollection<Vote> Votes
        {
            get
            {
                return this.votes;
            }

            set
            {
                this.votes = value;
            }
        }
    }
}